#include<iostream>
#include<cstring>
using namespace std;
int cnt[100];
void fun(const char* str)
{
	int n = strlen(str);
	int j = 0;
	int ma = 0, idx = 0;
	for (int i = 0; i < n; i++) {
		int x = str[i] - 'a' + 1;
		if (str[i] >= 'A' && str[i] <= 'Z')x = str[i] - 'A' + 27;
		cnt[x]++;
		while (cnt[x] >= 2) {
			int y = str[j] - 'a' + 1;
			if (str[j] >= 'A' && str[j] <= 'Z')y = str[j] - 'A' + 27;
			cnt[y]--;
			j++;
		}
		int res = i - j + 1;
		if (res >= ma) {
			ma = res;
			idx = j;
		}
	}
	while (ma--) {
		cout << str[idx++];
	}
}
int main()
{
	fun("aBbhjkhabxk");
	return 0;
}